{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "54660983",
   "metadata": {},
   "source": [
    "# 本周学习目标\n",
    ">1. 字典的方法\n",
    ">2. 实践"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "083577cc",
   "metadata": {},
   "source": [
    "## 1.字典的方法\n",
    "\n",
    "*len()查看长度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "b6977102",
   "metadata": {},
   "outputs": [],
   "source": [
    "动物园={\n",
    "    1001:\"狮子\",\n",
    "    1002:\"老虎\",\n",
    "    1003:\"意大利黑野猪\",\n",
    "    1004:\"法兰西大耗子\",\n",
    "    1005:\"黑龙江红长虫\"   \n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "bcc54774",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(动物园)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ef439975",
   "metadata": {},
   "source": [
    "### 1.2字典的一些方法\n",
    ">1. 字典增加"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "7b856888",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1001: '狮子', 1002: '老虎', 1003: '意大利黑野猪', 1004: '法兰西大耗子', 1005: '黑龙江红长虫'}"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 先查询key是否存在\n",
    "动物园"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "482cef4f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "该动物以存在，请更换key\n"
     ]
    }
   ],
   "source": [
    "if 1004 in 动物园:\n",
    "    print(\"该动物以存在，请更换key\")\n",
    "else:\n",
    "    动物园[1004]=\"北美环尾狐猴\"\n",
    "    print(\"增加成功\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9ce8b8e6",
   "metadata": {},
   "source": [
    ">2. 字典的修改\n",
    ">>1. 先查询要修改的key是否存在\n",
    ">>2. 如果不存在该key，可能需要考虑是否新增动物"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "8ce43939",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "更换成功\n"
     ]
    }
   ],
   "source": [
    "if 1001 in 动物园:\n",
    "    动物园[1001]=\"澳洲蜥蜴\"\n",
    "    print(\"更换成功\")\n",
    "else:\n",
    "    print(\"该key没有找到\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "6d2f84cc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1001: '澳洲蜥蜴', 1002: '老虎', 1003: '意大利黑野猪', 1004: '法兰西大耗子', 1005: '黑龙江红长虫'}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "动物园"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "3c301ba7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "老虎\n"
     ]
    }
   ],
   "source": [
    "# 字典的查询 ： get() 能够查询大该key的结果\n",
    "print(动物园.get(1002))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0d303618",
   "metadata": {},
   "source": [
    "# 1.2字典的一般方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "2fa36dcc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1001: '澳洲蜥蜴', 1002: '老虎', 1003: '意大利黑野猪', 1004: '法兰西大耗子', 1005: '黑龙江红长虫'}"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "动物园"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "d539c5c9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_items([(1001, '澳洲蜥蜴'), (1002, '老虎'), (1003, '意大利黑野猪'), (1004, '法兰西大耗子'), (1005, '黑龙江红长虫')])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "动物园.items()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "9dbc8bec",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys([1001, 1002, 1003, 1004, 1005])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# dict.keys():取出全部的key\n",
    "动物园.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "741d4db4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_values(['澳洲蜥蜴', '老虎', '意大利黑野猪', '法兰西大耗子', '黑龙江红长虫'])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "动物园.values()\n",
    "# dict_values() 取出全部的values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "fdaa1bfa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1005, '黑龙江红长虫')"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# popitem()    随机删除1个\n",
    "动物园.popitem()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "517dd1e7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'老虎'"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pop()   指定删除\n",
    "动物园.pop(1002)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "d1994cc7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1001: '澳洲蜥蜴', 1003: '意大利黑野猪', 1004: '法兰西大耗子'}"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "动物园"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1e7eb4b6",
   "metadata": {},
   "source": [
    "### 字典的两个高级用法\n",
    "* fromkeys\n",
    "* setdefaut"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "a16e736d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function fromkeys:\n",
      "\n",
      "fromkeys(iterable, value=None, /) method of builtins.type instance\n",
      "    Create a new dictionary with keys from iterable and values set to value.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# 复位，重启，重置\n",
    "help(动物园.fromkeys)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "3455dc2b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'澳洲蜥蜴': 100, '意大利黑野猪': 100, '法兰西大耗子': 100}"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 重置系统魔物的属性，所有动物 hp 100\n",
    "动物园.values()\n",
    "游戏={}\n",
    "游戏.fromkeys(动物园.values(),100)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "2b114580",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1001: '澳洲蜥蜴', 1003: '意大利黑野猪', 1004: '法兰西大耗子'}"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "动物园"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a65000af",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "79ea76bf",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "NFU={\n",
    "    \"status\":\"1\",\"regeocode\":{\"roads\":[{\"id\":\"020F49F0050461206\",\"location\":\"113.678,23.6284\",\"direction\":\"北\",\"name\":\"博学路\",\"distance\":\"7.63232\"},{\"id\":\"020F49F0050462229\",\"location\":\"113.679,23.6245\",\"direction\":\"北\",\"name\":\"老虎形街\",\"distance\":\"445.159\"},{\"id\":\"020F49F0050462451\",\"location\":\"113.677,23.6347\",\"direction\":\"南\",\"name\":\"中山路\",\"distance\":\"708.299\"}],\"roadinters\":[{\"second_name\":\"中山路\",\"first_id\":\"020F49F0050461206\",\"second_id\":\"020F49F0050462451\",\"location\":\"113.676794,23.634661\",\"distance\":\"708.299\",\"first_name\":\"博学路\",\"direction\":\"南\"}],\"formatted_address\":\"广东省广州市从化区温泉镇博学路广州南方学院\",\"addressComponent\":{\"city\":\"广州市\",\"province\":\"广东省\",\"adcode\":\"440117\",\"district\":\"从化区\",\"towncode\":\"440117100000\",\"streetNumber\":{\"number\":\"24号\",\"location\":\"113.677267,23.629149\",\"direction\":\"西北\",\"distance\":\"129.943\",\"street\":\"博学路\"},\"country\":\"中国\",\"township\":\"温泉镇\",\"businessAreas\":[[]],\"building\":{\"name\":[],\"type\":[]},\"neighborhood\":{\"name\":[],\"type\":[]},\"citycode\":\"020\"},\"aois\":[{\"area\":\"528560.656426\",\"type\":\"141201\",\"id\":\"B00140MR9A\",\"location\":\"113.679257,23.632577\",\"adcode\":\"440117\",\"name\":\"广州南方学院\",\"distance\":\"0\"}],\"pois\":[{\"id\":\"B00140MR9A\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"温泉大道882号\",\"poiweight\":\"0.450402\",\"name\":\"广州南方学院\",\"location\":\"113.679257,23.632577\",\"distance\":\"470.792\",\"tel\":[],\"type\":\"科教文化服务;学校;高等院校\"},{\"id\":\"B0FFG4TAF2\",\"direction\":\"东南\",\"businessarea\":[],\"address\":\"温泉镇乌土村松浪队5号(近博学路)\",\"poiweight\":\"0.237309\",\"name\":\"广州南方公寓\",\"location\":\"113.678983,23.627778\",\"distance\":\"102.617\",\"tel\":\"13622768437\",\"type\":\"商务住宅;商务住宅相关;商务住宅相关\"},{\"id\":\"B0H6FA18J5\",\"direction\":\"东南\",\"businessarea\":[],\"address\":\"从莞深高速(广州南方学院南侧)\",\"poiweight\":\"0.223065\",\"name\":\"保利半山花园\",\"location\":\"113.679348,23.627551\",\"distance\":\"146.921\",\"tel\":[],\"type\":\"商务住宅;住宅区;住宅区\"},{\"id\":\"B0HGD588HJ\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"博学路\",\"poiweight\":\"0.221662\",\"name\":\"广州南方学院教学楼4号\",\"location\":\"113.677460,23.630490\",\"distance\":\"242.901\",\"tel\":[],\"type\":\"科教文化服务;学校;学校\"},{\"id\":\"B0FFIMHNV3\",\"direction\":\"东\",\"businessarea\":[],\"address\":\"保利半山花园西北侧110米\",\"poiweight\":\"0.213931\",\"name\":\"汉堡小亨(广州南方学院分店)\",\"location\":\"113.678653,23.628407\",\"distance\":\"38.1716\",\"tel\":\"18825152009\",\"type\":\"餐饮服务;快餐厅;快餐厅\"},{\"id\":\"B0FFM1K4PF\",\"direction\":\"东\",\"businessarea\":[],\"address\":\"保利桃花源(温泉镇中山大学南方学院后门)\",\"poiweight\":\"0.272494\",\"name\":\"南苑小筑沈阳师兄\",\"location\":\"113.678570,23.628390\",\"distance\":\"30.0405\",\"tel\":\"+862126137886,6625081\",\"type\":\"住宿服务;住宿服务相关;住宿服务相关\"},{\"id\":\"B00140TWHT\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"笃行路2号\",\"poiweight\":\"0.157653\",\"name\":\"教工住宅1号\",\"location\":\"113.678490,23.630432\",\"distance\":\"222.658\",\"tel\":[],\"type\":\"商务住宅;住宅区;住宅小区\"},{\"id\":\"B0FFHRJDM9\",\"direction\":\"东南\",\"businessarea\":[],\"address\":\"中大南方学院南门1号\",\"poiweight\":\"0.256152\",\"name\":\"中南公寓\",\"location\":\"113.680340,23.627566\",\"distance\":\"231.223\",\"tel\":\"13711245345\",\"type\":\"商务住宅;住宅区;住宅小区\"},{\"id\":\"B0HGDU76L2\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"博学路\",\"poiweight\":\"0.221662\",\"name\":\"广州南方学院2号实验楼\",\"location\":\"113.678211,23.630956\",\"distance\":\"280.003\",\"tel\":[],\"type\":\"科教文化服务;学校;学校\"},{\"id\":\"B0FFHC4XU0\",\"direction\":\"东北\",\"businessarea\":[],\"address\":\"温泉大道886号\",\"poiweight\":\"0.191595\",\"name\":\"中山大学南方学院学术交流中心\",\"location\":\"113.679959,23.630496\",\"distance\":\"285.635\",\"tel\":[],\"type\":\"科教文化服务;科教文化场所;科教文化场所\"},{\"id\":\"B0FFLF90I2\",\"direction\":\"东北\",\"businessarea\":[],\"address\":\"笃行路20、22、24号广州南方学院商业中心1层1F015\",\"poiweight\":\"0.209448\",\"name\":\"煌上煌酱鸭(广州南方学院店)\",\"location\":\"113.679965,23.630156\",\"distance\":\"256.772\",\"tel\":\"13712317721\",\"type\":\"餐饮服务;快餐厅;快餐厅\"},{\"id\":\"B0FFKP838K\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"博学路25号\",\"poiweight\":\"0.191742\",\"name\":\"教学楼3号(外国语学院)\",\"location\":\"113.677247,23.630947\",\"distance\":\"298.093\",\"tel\":[],\"type\":\"科教文化服务;学校;高等院校\"},{\"id\":\"B0FFL7NUA2\",\"direction\":\"东北\",\"businessarea\":[],\"address\":\"广州南方学院\",\"poiweight\":\"0.224259\",\"name\":\"湖边纸包鱼\",\"location\":\"113.679861,23.630285\",\"distance\":\"260.939\",\"tel\":\"13924024938\",\"type\":\"餐饮服务;中餐厅;四川菜(川菜)\"},{\"id\":\"B0IB2GMPW4\",\"direction\":\"东北\",\"businessarea\":[],\"address\":\"温泉镇笃行路20、22、24号中山大学南方学院商业中心一楼1F-005\",\"poiweight\":\"0.218331\",\"name\":\"古茗(南方学院店)\",\"location\":\"113.680105,23.630681\",\"distance\":\"311.024\",\"tel\":\"18027267535\",\"type\":\"餐饮服务;休闲餐饮场所;休闲餐饮场所\"},{\"id\":\"B0HGDU8NLD\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"博学路附近\",\"poiweight\":\"0.221662\",\"name\":\"广州南方学院1号实验楼\",\"location\":\"113.678215,23.631370\",\"distance\":\"326.007\",\"tel\":[],\"type\":\"科教文化服务;学校;学校\"},{\"id\":\"B0HGD58UTU\",\"direction\":\"西北\",\"businessarea\":[],\"address\":\"博学路\",\"poiweight\":\"0.191229\",\"name\":\"广州南方学院2号教学楼\",\"location\":\"113.677060,23.631346\",\"distance\":\"346.352\",\"tel\":[],\"type\":\"科教文化服务;学校;学校\"},{\"id\":\"B0H25SMRKP\",\"direction\":\"东北\",\"businessarea\":[],\"address\":\"温泉大道882号\",\"poiweight\":\"0.263595\",\"name\":\"广州南方学院大礼堂\",\"location\":\"113.680076,23.631502\",\"distance\":\"386.65\",\"tel\":[],\"type\":\"科教文化服务;会展中心;会展中心\"},{\"id\":\"B0HGDU92JD\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"博学路19号\",\"poiweight\":\"0.221662\",\"name\":\"广州南方学院教学楼1号\",\"location\":\"113.677077,23.631783\",\"distance\":\"391.548\",\"tel\":[],\"type\":\"科教文化服务;学校;学校\"},{\"id\":\"B0HGD592BJ\",\"direction\":\"东北\",\"businessarea\":[],\"address\":\"温泉大道886号广州南方学院内\",\"poiweight\":\"0.221662\",\"name\":\"广州南方学院综合楼\",\"location\":\"113.680117,23.631544\",\"distance\":\"392.731\",\"tel\":[],\"type\":\"科教文化服务;学校;学校\"},{\"id\":\"B0FFKP81F0\",\"direction\":\"西北\",\"businessarea\":[],\"address\":\"博学路与中山路交叉口南340米\",\"poiweight\":\"0.191742\",\"name\":\"教学楼1号(文学与传媒学院)\",\"location\":\"113.676866,23.631736\",\"distance\":\"393.93\",\"tel\":[],\"type\":\"科教文化服务;科教文化场所;科教文化场所\"},{\"id\":\"B0FFLBEOND\",\"direction\":\"东北\",\"businessarea\":[],\"address\":\"从莞深高速(广州南方学院)\",\"poiweight\":\"0.190963\",\"name\":\"聚贤楼10号\",\"location\":\"113.681253,23.631036\",\"distance\":\"418.51\",\"tel\":[],\"type\":\"商务住宅;住宅区;宿舍\"},{\"id\":\"B0FFH6K3U9\",\"direction\":\"西北\",\"businessarea\":[],\"address\":\"温泉镇温泉大道882号广州南方学院H7栋1-5层\",\"poiweight\":\"0.254885\",\"name\":\"广州中大南方招待所\",\"location\":\"113.676330,23.631332\",\"distance\":\"378.102\",\"tel\":\"020-61787222\",\"type\":\"住宿服务;住宿服务相关;住宿服务相关\"},{\"id\":\"B0HGD58NF8\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"温泉大道882号广州南方学院新综合楼2层\",\"poiweight\":\"0.191229\",\"name\":\"广州南方学院达人书院\",\"location\":\"113.679041,23.632392\",\"distance\":\"446.366\",\"tel\":[],\"type\":\"科教文化服务;科教文化场所;科教文化场所\"},{\"id\":\"B0FFKUVYWV\",\"direction\":\"东北\",\"businessarea\":[],\"address\":\"保利桃花源\",\"poiweight\":\"0.273168\",\"name\":\"广州和风庭阿七度假别墅\",\"location\":\"113.681736,23.630569\",\"distance\":\"424.35\",\"tel\":\"+862126137886,4618482\",\"type\":\"住宿服务;住宿服务相关;住宿服务相关\"},{\"id\":\"B0FFIXV3OZ\",\"direction\":\"西北\",\"businessarea\":[],\"address\":\"温泉镇广州南方学院博学路6号\",\"poiweight\":\"0.182221\",\"name\":\"广州南方学院第一食堂\",\"location\":\"113.675848,23.631818\",\"distance\":\"450.091\",\"tel\":[],\"type\":\"餐饮服务;中餐厅;中餐厅\"},{\"id\":\"B0FFL7C054\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"温泉镇博学路882号(广州南方学院商业中心1层)\",\"poiweight\":\"0.317505\",\"name\":\"广州U优森特酒店\",\"location\":\"113.679226,23.632528\",\"distance\":\"464.819\",\"tel\":\"15813395296\",\"type\":\"住宿服务;住宿服务相关;住宿服务相关\"},{\"id\":\"B0HGDU92JC\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"博学路附近\",\"poiweight\":\"0.221662\",\"name\":\"广州南方学院4号实验楼\",\"location\":\"113.679963,23.632652\",\"distance\":\"498.883\",\"tel\":[],\"type\":\"科教文化服务;学校;学校\"},{\"id\":\"B0HGDU99RM\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"温泉大道882号广州南方学院内\",\"poiweight\":\"0.257947\",\"name\":\"广州南方学院图书馆\",\"location\":\"113.679177,23.632762\",\"distance\":\"489.331\",\"tel\":\"020-61787368;020-61787371\",\"type\":\"科教文化服务;图书馆;图书馆\"},{\"id\":\"B0FFHHKASW\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"温泉镇广州南方学院后门润泰超市1层\",\"poiweight\":\"0.210069\",\"name\":\"栗子家蛋糕店\",\"location\":\"113.679283,23.632574\",\"distance\":\"471.03\",\"tel\":[],\"type\":\"餐饮服务;糕饼店;糕饼店\"},{\"id\":\"B0FFK28XPU\",\"direction\":\"北\",\"businessarea\":[],\"address\":\"博学路广州南方学院后门润泰超市首层23号\",\"poiweight\":\"0.213875\",\"name\":\"我家厨房\",\"location\":\"113.679291,23.632563\",\"distance\":\"470.033\",\"tel\":[],\"type\":\"餐饮服务;中餐厅;中餐厅\"}]},\"info\":\"OK\",\"infocode\":\"10000\"\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "936b2ef1",
   "metadata": {},
   "source": [
    "# 1. 请找出NFS这个字典的所有key\n",
    "> 字典的嵌套"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "69b862b5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['status', 'regeocode', 'info', 'infocode'])"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 梦 的第一层；NFU\n",
    "NFU.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "21b3cc84",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'1'"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "NFU['status']# status 已经达到到最底层\n",
    "\n",
    "# 梦 的第二层；NFU['regeocode']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "d795e953",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['roads', 'roadinters', 'formatted_address', 'addressComponent', 'aois', 'pois'])"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "NFU['regeocode'].keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "6d580665",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 梦 的第三层 NFU['regeocode']['pois']\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ce8df6d5",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 找到目标\n",
    "# 1.请问： NFU_pois 有多少数据（任何数据都是有长度的）\n",
    "# 2.让我看看第十个数据长什么样（列表的取值）\n",
    "# 3.取值：取出第十个数据中的 name\n",
    "# 4. 这些数据中 所有的name 都是什么？\n",
    "# 5. 找出direction 朝北的所有 name 加上条件判断\n",
    "# 6. 找出有 tel 的 name"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
